﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<CRM.Database.Model.TurnoverType>" %>
<%@ Import Namespace="CRM.Controllers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Загрузка оборотов
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2>Загрузка оборотов</h2>

<% using (Html.BeginForm("Turnovers", "Test", FormMethod.Post, new { @class = "edit_form", enctype = "multipart/form-data" }))
       {

           var turnoverClassificationCol = new CRM.Database.Model.TurnoverClassificationsCollection();
           var productMarksCol = new CRM.Database.Model.ProductMarksCollection();
       
       %>
    <%: Html.ValidationSummary(true) %>


    <%:Html.DevExpress().Label(settings =>
                  {
                      settings.ControlStyle.CssClass = "lable";
                      settings.Text = "Прикрепляемый файл:";
                      settings.Width = 232;
                  }).GetHtml() %>
    <br /><input type="file" name="file" /><br />

    <%:Html.DevExpress().Label(settings =>
                {
                    settings.ControlStyle.CssClass = "lable";
                    settings.Text = "Классификация оборота:";
                    settings.AssociatedControlName = "IdTurnoverClassification";
                    settings.Width = 300;
                }).GetHtml()%>

            <%: Html.DevExpress().ComboBox(settings =>
                {
                    settings.Name = "IdTurnoverClassification";
                    settings.ControlStyle.CssClass = "editor";
                    settings.Properties.TextField = "LocalizedName";
                    settings.Properties.ValueField = "IdTurnoverClassification";
                    settings.Properties.ValueType = typeof (int);
                    settings.Width = 300;
                }).BindList(turnoverClassificationCol.TurnoverClassificationsList).Bind(Model.IdTurnoverClassification).GetHtml()%>

    <br />

    <%:Html.DevExpress().Label(settings =>
                {
                    settings.ControlStyle.CssClass = "lable";
                    settings.Text = "Марка:";
                    settings.AssociatedControlName = "IdProductMark";
                    settings.Width = 300;
                }).GetHtml()%>

            <%: Html.DevExpress().ComboBox(settings =>
                {
                    settings.Name = "IdProductMark";
                    settings.ControlStyle.CssClass = "editor";
                    settings.Properties.TextField = "ProductMark";
                    settings.Properties.ValueField = "IdProductMark";
                    settings.Properties.ValueType = typeof (int);
                    settings.Width = 300;
                }).BindList(productMarksCol.ProductMarksActiveList).Bind(Model.IdProductMark).GetHtml()%>

    <br />

    <button type="submit" value="Загрузить">Загрузить</button>
    <% } %>

</asp:Content>
